﻿using System;
using System.Collections.Generic;
using TimeTracker.app;

namespace TimeTracker.data
{
    internal class Project
    {
        private SortedDictionary<Int32, Task> tasks;
        public List<string> Assigned { get; private set; }

        public string Name { get; set; }

        public Project(string name)
        {
            Name = name;
            //load data
        }

        public bool LoadTasks()
        {
            tasks = Program.Connector.LoadTasks(this);
            return tasks != null;
        }

        public Task this[int id]
        {
            get { return tasks[id]; }
        }

        public bool IsAssigned(string user)
        {
            return Assigned.Contains(user);
        }
        
    }
}